package com.zhuoyian.xmppchat;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import io.rong.imkit.RongIM;
import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Message;

public class MainActivity extends Activity implements View.OnClickListener {

    private Button mButton;
    private Button mButton2;
    private Button mButton3;
    private Button mButton4;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        setListener();
    }

    private void setListener() {
        mButton.setOnClickListener(this);
        mButton2.setOnClickListener(this);
        mButton3.setOnClickListener(this);
        mButton4.setOnClickListener(this);
    }

    private void initView() {
        mButton = (Button) findViewById(R.id.btn1);
        mButton2 = (Button) findViewById(R.id.btn2);
        mButton3 = (Button) findViewById(R.id.btn3);
        mButton4 = (Button) findViewById(R.id.btn4);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
        	case R.id.btn1:
                RongIM.getInstance().setOnReceiveMessageListener(new RongIMClient.OnReceiveMessageListener() {

                    @Override
                    public boolean onReceived(Message message, int i) {
                        return false;
                    }
                });
        		break;
            case R.id.btn2:

                break;
            case R.id.btn3:

                break;
            case R.id.btn4:

                break;

        	default:
        		break;
        }
    }
}
